package cn.kgc.springboot.controller;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author mosin
 * date 2021/12/14
 * @version 1.0
 */
@Controller
@RequestMapping("/redis")
public class RedisController {

    @RequestMapping("/r1")
    @ResponseBody
    public String hello(){
        RedisTemplate<String, String> redisTemplate = new RedisTemplate<>();
        redisTemplate.opsForValue().set("name", "tom");
        return  "ok";
    }

}
